facebook

Web Service Client Example

  1. MyEclipse Archived
  2.  > 
  3. Documentation
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #265604 Reply

    ajerrom
    Member

    Just tried the Web Service Client Example posted on 8th jan 2007 at http://www.myeclipseide.com/images/tutorials/demos/terra_server_client/tutorial.html and followed all three flash demos but got an exception. Turns out that my version of myeclipse (20061111-5.1.0-GA) did not add the XFire 1.2 HTTP Client Libraries by default.

    To fix this you need to right click on project name, select Build Path->Add Libraries. Select “Myeclipse Libraries” from the Add Library window and click next. scroll down the list until you find Xfire 1.2 HTTP Client Libraries, check the box and then click finish.

    Don;t forget to add the import statements for the service objects you want to use in the client program as well.

    #265627 Reply

    Riyad Kalla
    Member

    Great catch, I just confirmed this is fixed in 5.5. Sorry for the confusion.

    #266976 Reply

    ajerrom
    Member

    Hi,

    I have used the Web Service Client Tutorial as the basis of a couple of projects without any problems so far. However, I just tried to generate some client classes using the following WSDL and I get an internal error during “Generate Client”. I cannot get XFire to generate the service classes. I am using Version: 5.1.0 Build id: 20061111-5.1.0-GA Any ideas?

    http://api.betdaq.com/v2.0/API.wsdl

    Many Thanks,

    Andy.

    #266979 Reply

    Brian Fernandes
    Moderator

    Andy,

    If you open the WSDL file in our WSDL editor and validate it, you’ll see that there’s an error with the “BaseResponse” component.

    Here’s the error I see.

    src-resolve.4.1: Error resolving component ‘BaseResponse’. It was detected that ‘BaseResponse’ has no namespace, but components with no target namespace are not referenceable from schema document ‘API.wsdl’. If ‘BaseResponse’ is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that ‘BaseResponse’ has no namespace, then an ‘import’ without a “namespace” attribute should be added to ‘API.wsdl’.

    If you correct that, the generation should work fine.

    #267447 Reply

    erjablow
    Member

    This is very nitpicky, but the tutorial has a few it’s/its mistakes:

    After our project has been created the next thing we need to do is let MyEclipse generate our web service client for us. In this step we are having MyEclipse connect to the web service, retrieve it’s WSDL and then in our project, generate all the classes and stubs required to…

    This occurs elsewhere in the tutorial too. Spellcheckers are no one’s friend.

    #269355 Reply

    I have just installed “MyEclipse_5.1.1GA_Installer.exe”
    on My Windows XP Eclipse 3.2.2 .
    My web service is on another url with the https url:
    https://192.168.43.64:18443/MTT_CC/services/ManagerCaller?wsdl

    when i try to create a web service client by applying the rules defined here http://www.myeclipseide.com/images/tutorials/demos/terra_server_client/tutorial.html

    i viewed the error message from
    Help–>About My Eclipse Enterprise Workbench–>Configuration Details–>View Error Log–>

    !MESSAGE Error generating services
    !STACK 0
    java.io.IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.0 403 Forbidden”
    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:1327)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:168)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:916)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
    at java.net.URL.openStream(URL.java:1007)
    at org.codehaus.xfire.util.Resolver.tryFileSystem(Resolver.java:74)
    at org.codehaus.xfire.util.Resolver.<init>(Resolver.java:44)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:82)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:92)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    why couldn’t i generate web service client?

    i am using C:\Program Files\Java\jdk1.5.0_07.
    And i signed the ceritificate by calling:

    C:\Program Files\Java\jdk1.5.0_07\bin>
    keytool -import -keystore ..\jre\lib\security\cacerts -alias o2cert -file ..\jre\lib\security\o2certificate.cer -keypass changeit
    Enter keystore password: changeit
    Owner: CN=Vodafone OKSIJEN, OU=IT, O=VODAFONE IT HIZMETLERI A.S., L=ISTANBUL, ST
    =MASLAK, C=TR
    Issuer: CN=Vodafone OKSIJEN, OU=IT, O=VODAFONE IT HIZMETLERI A.S., L=ISTANBUL, S
    T=MASLAK, C=TR
    Serial number: 459cf095
    Valid from: Thu Jan 04 14:18:29 EET 2007 until: Mon Jun 22 15:18:29 EEST 2009
    Certificate fingerprints:
    MD5: 15:21:5D:CE:3B:E3:5C:88:BD:2A:1B:C3:05:75:C6:E3
    SHA1: 7A:2B:AA:D3:B2:C8:72:E1:7F:F8:DE:9B:A1:24:5F:3F:4E:BC:21:3C
    Trust this certificate? [no]: y
    Certificate was added to keystore

    Where is my problem?

    #269362 Reply

    Riyad Kalla
    Member

    !STACK 0
    java.io.IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.0 403 Forbidden”
    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:1327)

    The exception seems pretty straight forward… the client generation wizard doesn’t like running through your proxy for some reason. Can you host the service locally and generate the client by pointing it at localhost instead?

    #271302 Reply

    crapo
    Member

    I am having difficulty understanding how proxies work with XFire. I tried the TerraServiceClient from the example and was not at all surprised to get the error:

    Jun 8, 2007 11:14:52 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
    Jun 8, 2007 11:14:52 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Jun 8, 2007 11:15:13 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
    Jun 8, 2007 11:15:13 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Jun 8, 2007 11:15:34 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
    Jun 8, 2007 11:15:34 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Jun 8, 2007 11:15:55 AM org.codehaus.xfire.transport.http.HttpChannel sendViaClient
    SEVERE: java.net.ConnectException: Connection timed out: connect

    I had to download the WSDL file an put it locally to generate the classes. I would have to provide my proxy information somehow before I would expect to be able to access the WSDL url from Java code or connect to the service, no?

    I would like to create a client that will invoke a service via a WSDL (no prior knowledge about the service implementation class), use a proxy, and use authentication. Haven’t found an example that puts these together, or even two together…

    #271825 Reply

    Ravi Juneja
    Member

    Good afternoon! I just ran through the webservices client example (http://www.myeclipseide.com/images/tutorials/demos/terra_server_client/tutorial.html) with MyEclipse 5.5 and there is a problem in the pasted code (last step in Step 4) that I can’t seem to resolve.

    In order to get the example most of the way home, I had to fully qualify several classes from the WSDL (see below), but the MyEclipse complains about the “terraServiceSoap” object reference in the following line:

    com.terraservice_usa.LonLatPt result = terraServiceSoap.convertPlaceToLonLatPt(place);

    It looks like changing “terraServiceSoap” to service (the actual TerraServiceSoap object in the source) fixes the problem.

    Chris

    #271843 Reply

    Riyad Kalla
    Member

    Chris,
    Thanks for the heads up, I’ll need to make a note of it and go back through that demo and see what needs to be updated.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Web Service Client Example

You must be logged in to post in the forum log in