Skip to Content
0
Former Member
Dec 23, 2012 at 05:52 AM

Not Able to pass SOAP Header Values to ASP.Net Webservice

229 Views

Hi Gurus

We are using SAP MII 12.0 to call a ASP.net webservice in our organization [within the Corp Network]. Below is the SOAP request structure for the webservice. Notice that it requires the username and Password [Hash] for the web-service , it is a part of the soap header

POST /dataservice/emsdataservice.asmx HTTP/1.1

Host: abc.an.bcko.com

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length

<?xml version="1.0" encoding="utf-8"?>

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

<soap12:Header>

<UserSoapHeader xmlns="http://ox.com/">

<Username>string</Username>

<Hash>string</Hash>

</UserSoapHeader>

</soap12:Header>

<soap12:Body>

<GetChemicalData xmlns="http:// ox.com/">

<MethodName>string</MethodName>

<ChemicalName>string</ChemicalName>

<Languages>

<string>string</string>

<string>string</string>

</Languages>

</GetChemicalData>

</soap12:Body>

</soap12:Envelope>

While I am able to connect to the webservice and the method at design time, the resulting request structure in MII webservice action call does not have the header structure. It only has the Body structure as you can see in the below screenshot.

I am not sure how I should pass /map the fields in the SOAP header section.

When I populate the parameter values and run the BLS service [with out theuser id and screenshot], I get the below generic error

[INFO ]: Execution Started At: 05:31:33

[ERROR]: Error Invoking Web Service Action: Status (500): Internal Server Error

[ERROR]: ACTION FAILED: End Action Call_ox_Web_Service : ( )

[INFO ]: Execution Completed At: 05:32:40 Elapsed Time was 66487 mS

For trial purpose, I build the complete request SOAP envelope in a Transaction Variable [hard coded values]. Even then I get the same error. Below is the XML i tried to post to the webservice call.

<?xml version="1.0" encoding="UTF-8"?><soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soap12:Header>

<UserSoapHeader xmlns="http://ox.com/">

<Username>ox</Username>

<Hash>9FA1E24FC63DB1BD33685</Hash>

</UserSoapHeader>

</soap12:Header>

<soap12:Body>

<GetChemicalData xmlns="http://ox.com/">

<MethodName>DPD</MethodName>

<ChemicalName>D-1-5244590/001</ChemicalName>

<Languages>

<string>EN</string>

</Languages>

</GetChemicalData>

</soap12:Body>

</soap12:Envelope>

I would really appreciate any help in this area.

Best Regards