Results 1 to 12 of 12

Thread: XML and Java

  1. #1
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default XML and Java

    Hi Guys
    I developed a webservice client to connect to web service, but my problem is that, it can connect but it takes longer than when i am connecting using SOAP UI.... below is my class: need help

    Java Code:
    package
    
    imports
    
    public class WebServiceTest {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    
    		OutboundVoiceRoutingServiceEndpointProxy ovrsep = new OutboundVoiceRoutingServiceEndpointProxy();
    		OutboundVoiceRouteRequest ovrr = new OutboundVoiceRouteRequest(
    				"mydomain", "1", "2", "WF_GET_ITEM", "WAZZUP",
    				new String[] { "123", "456" }, "WAZZUP", "698125",
    				"string");
    
    		System.out.println("Start time: " + System.currentTimeMillis());
    
    		try {
    
    			System.out.println("Invoking webservice");
    			RouteResult rr = ovrsep.newOutboundVoiceRouteRequest(ovrr);
    			System.out.println("RouteResultMsg: " + rr.getMessage());
    			System.out.println("RouteResult: " + rr.getResult().getValue());
    
    		} catch (java.rmi.RemoteException re) {
    			System.out.println("RemoteException: " + re.getMessage());
    		} catch (Exception exc) {
    			System.out.println("Exception: " + exc.getMessage());
    		}
    
    		System.out.println("End time: " + System.currentTimeMillis());
    
    		System.out.println("Done!");
    	}
    
    }
    thanks
    Last edited by Fubarable; 06-07-2010 at 10:58 PM. Reason: Moderator edit: code tags added

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    What do you mean by "takes longer"?
    What sort of times are we talking about, and do you think it might be an idea to fire, say, 10 of these calls off here and see if there's any difference between them?

  3. #3
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default xml and java

    when i say it takes longer i mean about 10min to give me back the results: but when accessing my webservice using SOAP UI, it returns the results within milliseconds:

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Then they're clearly not going the same route?
    Have you looked at the outgoing message and made sure it's the same one?

  5. #5
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default

    Hi,

    I am sure they are going the same route, they return the same results:
    SOAP UI results
    <response>
    <message>Interaction source ? doesn't exist</message>
    <result>ERROR_UNKNOWN_INTERACTION_SOURCE</result>
    </response>


    and the java application results:

    Invoking webservice
    RouteResultMsg: Interaction source WF_GET_ITEM doesn't exist
    RouteResult: ERROR_UNKNOWN_INTERACTION_SOURCE
    End time: 1275985025685
    Done!

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    You're making assumptions.
    Neither Jax-WS nor Axis are going to add 10 minutes to a web service call, therefore there is something different about the call itself between the two setups.

    Look at the outgoing message...time the performance on the web service itself, rather than on the client...are both the SOAP UI call and the Java call from the same location?

    And those responses are different, unless getMessage() is replacing the "?" with the "WF_GET_ITEM".

  7. #7
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default

    Ill investigate, it might be something different about the two set-up's like you say....

    Thanks.

  8. #8
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default

    Hi there,
    Another thing, the webservice i am trying to call, is located somewhere not on my machine, what i just did is to create the main method to call it:

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    So presumably that means you can't get timings from that server?

    I'd still confirm the outgoing message and ensure both are doing the same thing.

  10. #10
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default

    Hi,
    like i say the web service is on the other server, and i only created the client, do i need the JAX-WS libraries in my class build path?

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Well, I would guess you have either them or Axis (I don't know which web service client setup you're using)...without them you wouldn't be able to either compile or run the code.

  12. #12
    tmotse is offline Member
    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0

    Default

    hi there,

    i managed, i used a SOAP example from this site: Tip: Send and receive SOAP messages with SAAJ
    my problem was that the classes that the wsdl generated were usin rpc:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •