cancel
Showing results for 
Search instead for 
Did you mean: 

Calling WCF Webservice From MII not using Webservice Action block

Former Member
0 Kudos

MII 12.1 SP 7 here.

I have an application where I need to call a webservice runing as self hosted Windows Communication Foundation application (No IIS). I can't use the BLS webservice action block because I need to dynamically assign the destination (the WCF program is running on several computers, any of which I need to send data to)

I have my wdsl structure, and using the webservice action block I can call the WCF program successfully, however since this destination of this action block cannot be parameterized (SAP COULD WE FIX THIS PLEASE???) My alternative is to use the HTTP post action. The WCF program is using basicHttpBinding. And I can successfully send information to it manually using a program like SoapUI.

Posting data like this works.


POST <a href="http://TestClient:8090/FileSave/FileSaver" TARGET="test_blank">http://TestClient:8090/FileSave/FileSaver</a> HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://tempuri.org/IFileSaver/FileSave"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: TestClient:8090
Content-Length: 470
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:FileSave>
         <!--Optional:-->
         <tem:FileName>Test.txt</tem:FileName>
         <!--Optional:-->
         <tem:FilePath>/Temp/</tem:FilePath>
         <!--Optional:-->
         <tem:FileData>VGhpcyBpcyBhIHRlc3Q=</tem:FileData>
      </tem:FileSave>
   </soapenv:Body>
</soapenv:Envelope>

{Code}

My content type is text/xml   encoding is UTF-8   What I can't seem to quite get is how to send  SOAPAction: "http://tempuri.org/IFileSaver/FileSave"   as post parameter since my content type is txt/XML   Normally I would have it as 

SOAPAction="http://tempuri.org/IFileSaver/FileSave"

Also it seems that the post action wants to send session cookie information as well  For example here is results of the post action (this was obtained by a packet sniffer)

POST /FileSave/FileSaver HTTP/1.1..Content-Type: text/xml;charset = utf-8..Content-Length: 511..Cookie: saplb_*=J2EE1812920)1812950; JSESSIONID=AMLR9kc_U9BUY2igeJRnmrROPQ9CUSjkLgHWqRsA_SAP; MYSAPSSO2=AjExMDAgAA5wb3J0YWw6aG9sdGtlZIgAB2RlZmF1bHQBAAdIT0xUS0VEAgADMDAwAwADQ0RBBAAMMjAxMTAzMjMxOTE5BQAEAAAACAoAB0hPTFRLRUT%2FAQYwggECBgkqhkiG9w0BBwKggfQwgfECAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHATGB0TCBzgIBATAiMB0xDDAKBgNVBAMTA0NEQTENMAsGA1UECxMESjJFRQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTEwMzIzMTkxOTQxWjAjBgkqhkiG9w0BCQQxFgQUy3s1QVU8mTPPEmqZTAIs9jWTyIEwCQYHKoZIzjgEAwQwMC4CFQCApBVDXdX5JAy6MEcvZgaPXhd2BwIVAL9oO2XjR84Zv2Mum%2FeoRgu6qipc..

Cache-Control: no-cache..Pragma: no-cache..User-Agent: Java/1.5.0_24..Host: TestClient:8090..Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2..Connection: keep-alive....<?xml version="1.0" encoding="UTF-8"?>..<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">.. <soapenv:Header/>.. <soapenv:Body>.

<tem:FileSave>.. <!Optional:>.. <tem:FileName>Test.txt</tem:FileName>.. <!Optional:>.. <tem:FilePath>/Test1/</tem:FilePath>.. <!Optional:>.. <tem:FileData>VGhpcyBpcyBhIHRlc3Qh</tem:FileData>.. </tem:FileSave>.. </soapenv:Body>..</soapenv:Envelope>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Doug,

I have this done on a customer project. I created a Local variable as datatype map. In this I create multiple entries like:

KEY VALUE

SOAPAction "http://www.funkserver.de/v3/FSP3InterlinkGatewayWS/action/InterlinkGatewayWS.Login"

Accept application/soap+xml, application/dime, multipart/related, text/*

Then I assigned this local variable to the HTTPPost.RequestProperties. That is what I did and it works like a charm.

BR

Pedro

Former Member
0 Kudos

I added what you suggest do my HTTPPost.RequestProperties however it still is not working. I can manually trigger the webservice using various SOAP testing utilities. However what I think is going on is that the session cookie information is causing me problems. I'm looking at modifying the web service to handle this, or try another method

This is somewhat unique in that this really isn't a tradtional web service hosted by IIS or Apache etc, its a self hosted WCF program.

Former Member
0 Kudos

Doug,

if you like, you can setup a webex session and i can take a look. did you sniffe with the tcptrace?

i will be available 2 hours from now.

br

pedro

Answers (1)

Answers (1)

Former Member
0 Kudos

Pedro pointed me in the right direction.

Thank you!