cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

HariCS23
Contributor
0 Kudos

Did you try to execute the WS from SoapUI tool ??

If it works from this tool...

Try to save your Request after you download the proxies of your WS in MII at design time.

Use that request file to populate your data and create a transaction variable with that data  like you did.

Map that to your WS action block request ..and execute.

Hope this helps.

Thanks

Hari

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Hari

The SOAP UI is a very good tool I was not aware of it thanks for suggesting it. As suggested by you  I was able to invoke the web service from SOAP UI and even get the response.

Below is the new request as generated by SOAP UI that I passed from SAP MII

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:haz="http:// ox.com/">

<soap:Header>

      <haz:UserSoapHeader>

         <!--Optional:-->

         <haz:Username>ox</haz:Username>

         <!--Optional:-->

         <haz:Hash>24FC63DB1BD33685</haz:Hash>

      </haz:UserSoapHeader>

</soap:Header>

<soap:Body>

      <haz:GetChemicalData>

         <!--Optional:-->

<haz:MethodName>DPD</haz:MethodName>

         <!--Optional:-->

<haz:ChemicalName>AP-0524.00-P01\001</haz:ChemicalName>

         <!--Optional:-->

         <haz:Languages>

            <!--Zero or more repetitions:-->

<haz:string>EN</haz:string>

         </haz:Languages>

      </haz:GetChemicalData>

</soap:Body>

</soap:Envelope>

I copied the request from SOAP UI and passed the same from SAP MII to the web service, unfortunately I still get the 500 error as below.

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

I also got the basis to extract the NW log for me. Below is what I see in  the applications.4.log

###

#1.5 #0A5C358AF306026F00041ED6013E00F60004D19F6DC71F09#1356382578614#/Applications/LHCommon#sap.com/xapps~xmii~ear#com.sap.lhcommon.webservice.SoapClient#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Error#1#/Applications/LHCommon#Plain###SOAP Invoke Error For http://scatlb42.na.scko.com/hazoxdataservice/emsdataservice.asmx#

#1.5 #0A5C358AF306026F00041ED8013E00F60004D19F6DC72140#1356382578614#/Applications/XMII/Xacute#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.actions.webservice.WebServiceAction#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Error#1#/Applications/XMII/Xacute#Plain###Error Invoking Web Service Action#

#1.5 #0A5C358AF306026F00041EDA013E00F60004D19F6DC72257#1356382578614#/Applications/XMII/Xacute/Runner#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.engine.RunnerLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Error#1#com.sap.xmii.xacute.engine.RunnerLog#Plain###[391f41a0-4e0c-11e2-8fbc-e05997a26619][ERROR]: Error Invoking Web Service Action: Status (500): Internal Server Error TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306026F00041EDC013E00F60004D19F6DC722B9#1356382578614#/Applications/XMII/Xacute/Runner#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.engine.RunnerLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Error#1#com.sap.xmii.xacute.engine.RunnerLog#Plain###[391f41a0-4e0c-11e2-8fbc-e05997a26619][ERROR]: ACTION FAILED: End Action Web_Service_0 : ( ) TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306026F00041EDF013E00F60004D19F6DC72570#1356382578615#/Applications/XMII/Xacute/Runner#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.engine.RunnerLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap.xmii.xacute.engine.RunnerLog#Plain###[391f41a0-4e0c-11e2-8fbc-e05997a26619][TRACE]: Request : <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:haz="http://ox.com/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">    <soap:Header>       <haz:UserSoapHeader>          <!--Optional:-->          <haz:Username>zox</haz:Username>          <!--Optional:-->          <haz:Hash>4FC63DB1BD33685</haz:Hash>       </haz:UserSoapHeader>    </soap:Header>    <soap:Body>       <haz:GetChemicalData>          <!--Optional:--> <haz:MethodName>GHS</haz:MethodName>          <!--Optional:-->          <haz:ChemicalName>L-1-5257415/001</haz:ChemicalName>          <!--Optional:-->          <haz:Languages>             <!--Zero or more repetitions:--> <haz:string>EN</haz:string>          </haz:Languages>       </haz:GetChemicalData>    </soap:Body> </soap:Envelope> TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306026F00041EE0013E00F60004D19F6DC74881#1356382578624#/Applications/XMII/Xacute/Runner#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.engine.RunnerLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Error#1#com.sap.xmii.xacute.engine.RunnerLog#Plain###[391f41a0-4e0c-11e2-8fbc-e05997a26619][ERROR]: Response : TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306026F00041EE3013E00F60004D19F6DC74975#1356382578624#/Applications/XMII/Xacute/Event#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.actions.logging.EventLogger#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap.xmii.xacute.actions.logging.EventLogger#Plain###[UserEvent] : #

#1.5 #0A5C358AF306026F00041EE6013E00F60004D19F6DC74A3D#1356382578625#/Applications/XMII/Xacute/Runner#sap.com/xapps~xmii~ear#com.sap.xmii.xacute.engine.RunnerLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap.xmii.xacute.engine.RunnerLog#Plain###[391f41a0-4e0c-11e2-8fbc-e05997a26619][TRACE]: Execution Completed At: 20:56:18 Elapsed Time was 60627 mS TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306026F00041EE8013E00F60004D19F6DC74E85#1356382578626#/Applications/XMII/Xacute#sap.com/xapps~xmii~ear#com.sap.xmii.servlet.Runner#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_26##0#0#Info#1#com.sap.xmii.servlet.Runner#Plain###Transaction [TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a] ran in [60680] ms.#

#1.5 #0A5C358AF30600960007985E013E00F60004D19F6DCC6D7C#1356382578961#/Applications/XMII#sap.com/xapps~xmii~ear#com.sap.xmii.system.SessionHandler#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.system.SessionHandler#Plain###Requested URL is http://AACx100.abcko.com:50000/XMII/Catalog#

#1.5 #0A5C358AF306009600079860013E00F60004D19F6DCC6EC7#1356382578962#/Applications/XMII#sap.com/xapps~xmii~ear#com.sap.xmii.system.SessionHandler#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.system.SessionHandler#Plain###Request Parameter: class="Transaction"#

#1.5 #0A5C358AF306009600079862013E00F60004D19F6DCC6F1B#1356382578962#/Applications/XMII#sap.com/xapps~xmii~ear#com.sap.xmii.system.SessionHandler#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.system.SessionHandler#Plain###Request Parameter: Mode=Delete#

#1.5 #0A5C358AF306009600079864013E00F60004D19F6DCC6F6E#1356382578962#/Applications/XMII#sap.com/xapps~xmii~ear#com.sap.xmii.system.SessionHandler#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.system.SessionHandler#Plain###Request Parameter: ObjectName=TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306009600079866013E00F60004D19F6DCC6FBE#1356382578962#/Applications/XMII#sap.com/xapps~xmii~ear#com.sap.xmii.system.SessionHandler#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.system.SessionHandler#Plain###Request Parameter: TemporaryFile=true#

#1.5 #0A5C358AF30600960007986C013E00F60004D19F6DCC8053#1356382578966#/Applications/XMII/Xacute/Event#sap.com/xapps~xmii~ear#com.sap.xmii.Illuminator.logging.AuditLog#A11111#122448##n/a##ee78f9854e0b11e2cf900a5c358af306#SAPEngine_Application_Thread[impl:3]_34##0#0#Info#1#com.sap.xmii.Illuminator.logging.AuditLog#Plain###IP 10.71.1.42 [A11111] - Mode: Delete; Type: ; sObject: TMP37eed7f1-4e0c-11e2-cdb3-c3b10a48882a#

#1.5 #0A5C358AF306F9AE00000000013E00F60004D19F6E6E92DB#1356382589588#/Applications/CC#sap.com/grc~ccxsysbgear#com.virsa.cc.common.util.CCLogger#Guest#0##n/a##63d310d34e0c11e2bfe70a5c358af306#Thread[Analysis Engine Daemon ID[3776550]/usr/sap/D97/JC00/j2ee/cluster/server0/. Thread ID 1,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error#1#com.virsa.cc.common.util.CCLogger#Plain#Connection timed out:could be due to invalid addressjava.net.PlainSocketImpl.socketConnect(Native Method)

  1. java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:355)
  2. java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:220)
  3. java.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)
  4. java.net.Socket.connect(Socket.java:479)
  5. java.net.Socket.connect(Socket.java:429)
  6. sun.net.NetworkClient.doConnect(NetworkClient.java:158)
  7. sun.net.www.http.HttpClient.openServer(HttpClient.java:442)
  8. sun.net.www.http.HttpClient.openServer(HttpClient.java:674)
  9. sun.net.www.http.HttpClient.<init>(HttpClient.java:340)
  10. sun.net.www.http.HttpClient.<init>(HttpClient.java:301)
  11. sun.net.www.http.HttpClient.New(HttpClient.java:373)
  12. sun.net.www.http.HttpClient.New(HttpClient.java:354)
  13. sun.net.www.http.HttpClient.New(HttpClient.java:349)
  14. sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:562)
  15. sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:539)
  16. sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:667)
  17. com.virsa.cc.xsys.bg.AnalysisDaemonThread.run(AnalysisDaemonThread.java:67)
  18. java.lang.Thread.run(Thread.java:770)

###

I hope I am looking in the right direction for the diagnosis of the issue. Please let me know if there is any other place I can look in the system to resolve this.

Best Regards

HariCS23
Contributor
0 Kudos

In my experience, Request created by SOAP UI tool and MII is little different. especially namespaces..and MII skips some information while creating proxies when you download the WS at design time.

You can get the WS request bu using tracer and try to fill in the input and see if that works.

Thanks

Hari