Hi,
I am trying to write web service client in android using android studio.
I tested client part using SoapUI it works fine. The SoapUI envelope is as follow:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.tibco.integration.jsc.com/">
<soapenv:Header>
<ws:Authentication>
<B2BAccount>99999999</B2BAccount>
<Password>99999999</Password>
<CustomerId>00123456</CustomerId>
<StateCode>01</StateCode>
<PillarId>D</PillarId>
</ws:Authentication>
</soapenv:Header>
<soapenv:Body>
<ws:placeWSOrder>
<WSOrder>1111111111111111</WSOrder>
<OrderType>01</OrderType>
</ws:placeWSOrder>
</soapenv:Body>
</soapenv:Envelope>
What I have tried:
I am creating header as follows in java:
elHeader[0] = new Element().createElement(strNameSpaceLocal, "Authentication");
Element elB2BAccount = new Element().createElement(strNameSpaceLocal, "B2BAccount");
elB2BAccount.addChild(Node.TEXT, "99999999");
elHeader[0].addChild(Node.ELEMENT, elB2BAccount);
Element elPassword = new Element().createElement(strNameSpaceLocal, "Password");
elPassword.addChild(Node.TEXT, "99999999");
elHeader[0].addChild(Node.ELEMENT, elPassword);
Element elCustomerId = new Element().createElement(strNameSpaceLocal, "CustomerId");
elCustomerId.addChild(Node.TEXT, "00123456");
elHeader[0].addChild(Node.ELEMENT, elCustomerId);
Element elStateCode = new Element().createElement(strNameSpaceLocal, "StateCode");
elStateCode.addChild(Node.TEXT, "01");
elHeader[0].addChild(Node.ELEMENT, elStateCode);
Element elPillarId = new Element().createElement(strNameSpaceLocal, "PillarId");
elPillarId.addChild(Node.TEXT, "D");
elHeader[0].addChild(Node.ELEMENT, elPillarId);
ssEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
ssEnvelope.dotNet = true;
ssEnvelope.implicitTypes = true;
ssEnvelope.setAddAdornments(false);
ssEnvelope.headerOut = elHeader;
But it does not work.
I am getting following Exception error:
Sending Order ! at 01022016 202424
Calling sendRequest ! at 01022016 202424
Send Order Error 1:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions name='Untitled' targetNamespace='http://www.jsc.com/RetailWebService/'>@3:297 in java.io.InputStreamReader@22691c6a) at 01022016 202425
Could you please tell me what is wrong in above code.
I will appreciate it.
Thank you.
Dev