Solved

Java  Web Service Error

Posted on 2010-09-07
13
2,722 Views
Last Modified: 2012-05-10
GiMy web service gives the given error on the below why this happens
Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection timed out: connect

        at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:121)

        at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:142)

        at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)

        at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)

        at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)

        at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)

        at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)

        at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)

        at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)

        at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)

        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)

        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)

        at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)

        at $Proxy33.login(Unknown Source)

        at WebService.Main.callWebService(Main.java:26)

        at WebService.Main.main(Main.java:57)

Caused by: java.net.ConnectException: Connection timed out: connect

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

        at java.net.Socket.connect(Socket.java:529)

        at java.net.Socket.connect(Socket.java:478)

        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)

        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)

        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)

        at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)

        at sun.net.www.http.HttpClient.New(HttpClient.java:306)

        at sun.net.www.http.HttpClient.New(HttpClient.java:323)

        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)

        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:839)

        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)

        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)

        at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:109)

        ... 15 more

Java Result: 1

BUILD SUCCESSFUL (total time: 24 seconds)

Open in new window

0
Comment
Question by:3XLcom
  • 5
  • 4
  • 2
  • +1
13 Comments
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 166 total points
ID: 33616611
0
 
LVL 16

Accepted Solution

by:
Valeri earned 334 total points
ID: 33616953
Your endpoint is wrong. Check it again. Probably it is something like "http://localhost:...." :-)
Replace it with the real one.
0
 

Author Comment

by:3XLcom
ID: 33617085
Error Turned to this :



Exception in thread "main" com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML tag. expected: {http://ws.dgpys.deloitte.com}LoginReport but found: {null}LoginReport

        at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:203)

        at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:211)

        at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:513)

        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:110)

        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)

        at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)

        at $Proxy33.login(Unknown Source)

        at Main.callWebService(Main.java:26)

        at Main.main(Main.java:57)

Java Result: 1

Open in new window

0
 
LVL 16

Expert Comment

by:Valeri
ID: 33617212
How you have created your WS? How you have obtained the WSDL?
The best way is to change the endpoint in the WSDL file and after that to create your stub.
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33617232
0
 

Author Comment

by:3XLcom
ID: 33617245
http://dgpys.teias.gov.tr/dgpys/services/EVDServis?wsdl
you could check this is my code :

and i added the webservice into a package with named : WebService thank you
/*

 * To change this template, choose Tools | Templates

 * and open the template in the editor.

 */







import WebService.IntValue;

import WebService.StringValue;

import javax.xml.bind.JAXBElement;

import javax.xml.namespace.QName;

import javax.xml.ws.Holder;





public class Main {

    QName qName = new QName("http://tempuri.org", "Test");

    public void callWebService() {

        WebService.EVDServis services = new WebService.EVDServis();

        System.out.print(services.getWSDLDocumentLocation());

        WebService.LoginMessage LMessage  = new WebService.LoginMessage();

        LMessage.setUserName(new Main().getUserName());

        LMessage.setPassword(new Main().getPass());

        services.getEVDServisSOAP11PortHttp().login(LMessage, new Main().Bilgi1(), new Main().Bilgi2());



        System.out.print("Son : " + Bilgi2().value.getV());

    }

    public JAXBElement<WebService.StringValue> getUserName() {

        StringValue sv = new StringValue() ;

        sv.setV("example");

        JAXBElement<StringValue> el = new JAXBElement<StringValue>(qName, StringValue.class, null, sv);

        return el;

   }

    public JAXBElement<WebService.StringValue> getPass() {

        StringValue sv = new StringValue() ;

        sv.setV("example");

        JAXBElement<StringValue> el = new JAXBElement<StringValue>(qName, StringValue.class, null, sv);

        return el;

   }

    public javax.xml.ws.Holder<WebService.IntValue> Bilgi1() {

        IntValue sv = new IntValue() ;

        sv.setV(1);

        Holder<WebService.IntValue> el = new Holder<WebService.IntValue>( sv);

        return el;

   }



    public javax.xml.ws.Holder<WebService.StringValue> Bilgi2() {

        StringValue sv = new StringValue() ;

        sv.setV("example");

        Holder<WebService.StringValue> el = new Holder<WebService.StringValue>( sv);

        return el;

   }

    public static void main(String[] args) {

         System.out.print("Deneme");

         new Main().callWebService();

         System.out.print("Deneme2");

         

    }



}

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 334 total points
ID: 33617775
trace your stub. whenever you have something like that 172.16.0.37, replace it with the real endpoint...
0
 

Author Comment

by:3XLcom
ID: 33618606
after i replace it error turned into this. when it was like 172.16.0.37 error was the given on the question
0
 

Author Comment

by:3XLcom
ID: 33618614
Real one is dgpys.teias.gov.tr  instead of 172.16.0.37:80
0
 
LVL 16

Expert Comment

by:Valeri
ID: 33624595
sorry...
So where this http://ws.dgpys.deloitte.com comes from?!
0
 

Author Comment

by:3XLcom
ID: 33624653
just a namespace
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37158221
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 83
@SBGen Method 3 37
Error trying to install RTMT Win7 5 41
Windows 10 IE Certificate Issue 10 42
When coding a Webservice to provide data, the normal way is to create a method that returns a Dataset object.   But a Dataset cannot be used easily from another platform, such as PHP,  FLAS (FLEX) , etc. Solution : Return a XML Document instea…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now