Forum Discussion

JGujarati's avatar
JGujarati
Occasional Contributor
16 years ago

remote access of mockservice

Hi,

I have mockservice running on my local machine, and I would like to access this mockservice from a different machine.

local end point
http://127.0.0.1:8088/mockTestSOAP

IP address of local machine, e.g.

11.22.00.33

used following end point to access above service from a remote machine

http://11.22.00.33:8088/mockTestSOAP


Is this possible  ? (I tried , but it didn't work)

How do I access it  ?

Please advise

thank you

Jignesh

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    it should definitely be possible! In what way does it not work? Are you getting errors in/from soapUI? Could there be a firewall not permitting access?

    regards,

    /Ole
    eviware.com
  • JGujarati's avatar
    JGujarati
    Occasional Contributor
    yes, looks like its firewall problem with my machine.

    I finally got to work the mock service/reponse.  But the J2EE client calling  this mock service is getting exception

    ....: An unexpected exception occured: java.lang.IllegalArgumentException: com.ibm.ws.webservices.engine.xmlsoap.Text incompatible with javax.xml.soap.SOAPElement from url ....

    After further debugging, found that client is looking for soap body in "firstChild" element, but its actually in "nextSibling". Here is the client code

    SOAPMessage reply = connection.call(message, getURL());

    responseSOAP = (SOAPElement)reply.getSOAPPart().getEnvelope().getBody().getFirstChild();


    We cannot change our client code to look for it in nextSibling.
    How can I send mock reponse in firstChild instead of in nextSibling ?

    Please advise

    thank you

    Jignesh
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    Please try setting the "Strip Whitespaces" property of the mockresponse to true (in the bottom left properties table when the mockresponse is selected), which should make the body the first child (instead of a text-node)

    regards,

    /Ole
    eviware.com
  • JGujarati's avatar
    JGujarati
    Occasional Contributor
    Stripping whitespace solved my problem. Thanks for the PROMPT responses.