Avatar of 3XLcom
3XLcom
 asked on

Java Web Service Error

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

JavaWeb Services

Avatar of undefined
Last Comment
mrcoffee365

8/22/2022 - Mon
SOLUTION
Gurvinder Pal Singh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Valeri

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
3XLcom

ASKER
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

Valeri

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.
Gurvinder Pal Singh

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
3XLcom

ASKER
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

SOLUTION
Valeri

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
3XLcom

ASKER
after i replace it error turned into this. when it was like 172.16.0.37 error was the given on the question
3XLcom

ASKER
Real one is dgpys.teias.gov.tr  instead of 172.16.0.37:80
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Valeri

sorry...
So where this http://ws.dgpys.deloitte.com comes from?!
3XLcom

ASKER
just a namespace
mrcoffee365

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy