3XLcom
asked on
Invoking a web service
Main method creating perfect xml for the invoke of webservice ;
but it is not invoking the web service how could i call and get the result from webservice
This is the answer of given code :
run:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:login xmlns:ns2="http://ws.dgpys.deloitte.com">
<ns3:Test xmlns:ns3="http://tempuri.org">
<ns3:Test v="example"/>
<ns3:Test v="example"/>
</ns3:Test>
</ns2:login>
BUILD SUCCESSFUL (total time: 1 second)
but it is not invoking the web service how could i call and get the result from webservice
This is the answer of given code :
run:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:login xmlns:ns2="http://ws.dgpys.deloitte.com">
<ns3:Test xmlns:ns3="http://tempuri.org">
<ns3:Test v="example"/>
<ns3:Test v="example"/>
</ns3:Test>
</ns2:login>
BUILD SUCCESSFUL (total time: 1 second)
public void callAsyncCallback(){
try { // Call Web Service Operation(async. callback)
PmumService.Login cr = new PmumService.Login();
cr.setLoginMessage( new Main().Mesaj());
// TODO initialize WS operation arguments here
javax.xml.ws.AsyncHandler<PmumService.Login> asyncHandler =
new javax.xml.ws.AsyncHandler<PmumService.Login>() {
public void handleResponse(javax.xml.ws.Response<PmumService.Login> response) {
try {
// TODO process asynchronous response here
System.out.println("Result = "+ response.get());
} catch(Exception ex) {
System.out.println(ex.toString());
}
}
};
} catch (Exception ex) {
System.out.println(ex.toString());
}
}
public static void main(String[] args) {
PmumService.Login cr = new PmumService.Login();
cr.setLoginMessage( new Main().Mesaj());
new Main().callAsyncCallback();
try
{
javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(cr.getClass().getPackage().getName());
javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(cr, System.out);
}
catch (javax.xml.bind.JAXBException ex)
{
// XXXTODO Handle exception
java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex); //NOI18N
}
}
I tried calling the service like this, but generates the original error you get ... seeing if I see what is wrong.
public static void main(String[] args) {
Main m = new Main();
Holder<IntValue> code = null;
Holder<StringValue> text = null;
try {
EVDServis service = new EVDServis();
LoginMessage msg = new LoginMessage();
StringValue sv = new StringValue();
sv.setV("example");
msg.setPassword(new JAXBElement<StringValue>(service.getServiceName(), StringValue.class, sv));
msg.setUserName(new JAXBElement<StringValue>(service.getServiceName(), StringValue.class, sv));
service.getEVDServisSOAP11PortHttp().login(msg, code, text);
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("code: " + code + "; text: " + text);
}
ASKER
I appreciate for all your help
this time it does not like :
EVDServis service = new EVDServis();
i tryed as this also
PmumService.EVDServis service = new PmumService.EVDServis();
error.png
this time it does not like :
EVDServis service = new EVDServis();
i tryed as this also
PmumService.EVDServis service = new PmumService.EVDServis();
error.png
It should be whatever the class name you gave the EVDServis when generated from the WSDL. If it is named default, then you probably just need the imports. You can click on Source --> Fix Imports.
ASKER
no way :( :'(
pufff :(
pufff :(
ASKER
I have added the service directly as a webservice client this time i get really bad error messages :D
init:
Deleting: C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\build\b uilt-jar.p roperties
deps-jar:
Updating property file: C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\build\b uilt-jar.p roperties
wsimport-init:
wsimport-client-EVDServis:
files are up to date
wsimport-client-generate:
Compiling 1 source file to C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\build\c lasses
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:21: cannot find symbol
symbol : class IntValue
location: class javaapplication6.Main
Holder<IntValue> code = null;
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:22: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
Holder<StringValue> text = null;
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:24: cannot find symbol
symbol : class EVDServis
location: class javaapplication6.Main
EVDServis service = new EVDServis();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:24: cannot find symbol
symbol : class EVDServis
location: class javaapplication6.Main
EVDServis service = new EVDServis();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:25: cannot find symbol
symbol : class LoginMessage
location: package javaapplication6
javaapplication6.LoginMess age msg = new javaapplication6.LoginMess age();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:25: cannot find symbol
symbol : class LoginMessage
location: package javaapplication6
javaapplication6.LoginMess age msg = new javaapplication6.LoginMess age();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:26: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
StringValue sv = new StringValue();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:26: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
StringValue sv = new StringValue();
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:28: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
msg.setPassword(new JAXBElement<StringValue>(s ervice.get ServiceNam e(), StringValue.class, sv));
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:28: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
msg.setPassword(new JAXBElement<StringValue>(s ervice.get ServiceNam e(), StringValue.class, sv));
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:29: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
msg.setUserName(new JAXBElement<StringValue>(s ervice.get ServiceNam e(), StringValue.class, sv));
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\src\jav aapplicati on6\Main.j ava:29: java.lang.StringValue is not public in java.lang; cannot be accessed from outside package
msg.setUserName(new JAXBElement<StringValue>(s ervice.get ServiceNam e(), StringValue.class, sv));
12 errors
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\nbproje ct\build-i mpl.xml:55 2: The following error occurred while executing this line:
C:\Users\Cahit\Documents\N etBeansPro jects\Java Applicatio n6\nbproje ct\build-i mpl.xml:26 2: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
init:
Deleting: C:\Users\Cahit\Documents\N
deps-jar:
Updating property file: C:\Users\Cahit\Documents\N
wsimport-init:
wsimport-client-EVDServis:
files are up to date
wsimport-client-generate:
Compiling 1 source file to C:\Users\Cahit\Documents\N
C:\Users\Cahit\Documents\N
symbol : class IntValue
location: class javaapplication6.Main
Holder<IntValue> code = null;
C:\Users\Cahit\Documents\N
Holder<StringValue> text = null;
C:\Users\Cahit\Documents\N
symbol : class EVDServis
location: class javaapplication6.Main
EVDServis service = new EVDServis();
C:\Users\Cahit\Documents\N
symbol : class EVDServis
location: class javaapplication6.Main
EVDServis service = new EVDServis();
C:\Users\Cahit\Documents\N
symbol : class LoginMessage
location: package javaapplication6
javaapplication6.LoginMess
C:\Users\Cahit\Documents\N
symbol : class LoginMessage
location: package javaapplication6
javaapplication6.LoginMess
C:\Users\Cahit\Documents\N
StringValue sv = new StringValue();
C:\Users\Cahit\Documents\N
StringValue sv = new StringValue();
C:\Users\Cahit\Documents\N
msg.setPassword(new JAXBElement<StringValue>(s
C:\Users\Cahit\Documents\N
msg.setPassword(new JAXBElement<StringValue>(s
C:\Users\Cahit\Documents\N
msg.setUserName(new JAXBElement<StringValue>(s
C:\Users\Cahit\Documents\N
msg.setUserName(new JAXBElement<StringValue>(s
12 errors
C:\Users\Cahit\Documents\N
C:\Users\Cahit\Documents\N
BUILD FAILED (total time: 0 seconds)
ASKER
I am nearly out of mind there is sth. really wrong this is my code given below and this is what i get as an answr
run-single:
unexpected XML tag. expected: {http://ws.dgpys.deloitte.com}LoginReport but found: {null}LoginReport
code: null; text: null
BUILD SUCCESSFUL (total time: 4 seconds)
run-single:
unexpected XML tag. expected: {http://ws.dgpys.deloitte.com}LoginReport but found: {null}LoginReport
code: null; text: null
BUILD SUCCESSFUL (total time: 4 seconds)
public static void main(String[] args) {
Main m = new Main();
Holder<javaapplication6.IntValue> code = null;
Holder<javaapplication6.StringValue> text = null;
try {
EVDServis service = new EVDServis();
javaapplication6.LoginMessage msg = new javaapplication6.LoginMessage();
javaapplication6.StringValue sv = new javaapplication6.StringValue();
sv.setV("example");
msg.setPassword(new JAXBElement<javaapplication6.StringValue>(service.getServiceName(), javaapplication6.StringValue.class, sv));
msg.setUserName(new JAXBElement<javaapplication6.StringValue>(service.getServiceName(), javaapplication6.StringValue.class, sv));
service.getEVDServisSOAP11PortHttp().login(msg, code, text);
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("code: " + code + "; text: " + text);
}
Exactly. It is same error as before. I am really thinking it is not returning XML we suspect when invalid credentials are passed, but was seeing if I could figure it out before posting back. Have another thought I need to test ... so please be patient.
ASKER
but when i use stylus studio 2010 i got the right answer i need to get this as an answer :
<?xml version="1.0" encoding="UTF-8"?><soapenv :Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing"><soapenv:Head er><wsa:Re plyTo><wsa :Address>http://www.w3.org/2005/08/addressing/none< /wsa:Addre ss><wsa:Re ferencePar ameters><a xis2:Servi ceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:D1 03FAD43998 C378311284 309692319< /axis2:Ser viceGroupI d></wsa:Re ferencePar ameters></ wsa:ReplyT o></soapen v:Header>< soapenv:Bo dy><LoginR eport><Cod e v="-1"/><Text v="Authorization error!"/></LoginReport></s oapenv:Bod y></soapen v:Envelope >
This is the right answer that i got from this test software
and this is very different from what we get
<?xml version="1.0" encoding="UTF-8"?><soapenv
This is the right answer that i got from this test software
and this is very different from what we get
ASKER
how we could write the answer xml to the output to see what is going on exactly ?
I was going to use the Dispatch code method, but I have been getting connection issues ... maybe try from your end.
public class EVDServisClient {
public static void main(String[] args) {
EVDServis service = new EVDServis();
QName portQName = new QName("http://ws.deloitte.com", "EVDServisSOAP11port_http");
String req = "<login xmlns=\"http://ws.deloitte.com\"><loginMessage><Password v=\"deneme\"/><UserName v=\"deneme\"/></loginMessage></login>";
try { // Call Web Service Operation
Dispatch<Source> sourceDispatch = null;
sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req)));
} catch (Exception ex) {
// TODO handle custom exceptions here
}
}
}
ASKER
Service.Mode giving error for me :(
ASKER
I resolved it but it generated this error :
javax.xml.ws.WebServiceExc eption: {http://ws.deloitte.com}EVDServisSOAP12port_http is not a valid port. Valid ports are: {http://ws.dgpys.deloitte.com}EVDServisSOAP12port_http ,{http://ws.dgpys.deloitte.com}EVDServ isSOAP11po rt_http
BUILD SUCCESSFUL (total time: 1 second)
What a silly error :D we already writing what it suggest :D
javax.xml.ws.WebServiceExc
BUILD SUCCESSFUL (total time: 1 second)
What a silly error :D we already writing what it suggest :D
ASKER
I reorgonized some codes and it worked perfect as this but i could not read the result
public static void main(String[] args) {
EVDServis service = new EVDServis();
QName portQName = new QName("http://ws.dgpys.deloitte.com", "EVDServisSOAP11port_http");
String req = "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\"><Body><login xmlns=\"http://ws.dgpys.deloitte.com\"><loginMessage><Password v=\"deneme\"/><UserName v=\"deneme\"/></loginMessage></login></Body></Envelope>";
try { // Call Web Service Operation
Dispatch<Source> sourceDispatch = null;
sourceDispatch = service.createDispatch(portQName, Source.class, javax.xml.ws.Service.Mode.MESSAGE );
Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req)));
} catch (WebServiceException wse){
wse.printStackTrace();
}
}
Yes, it was weird the Dispatch code was generated by Netbeans with the wrong namespace.
ASKER
This is where i am at the end and this is result :
Exception in thread "main" javax.xml.ws.soap.SOAPFaul tException : The endpoint reference (EPR) for the Operation not found is http://dgpys.teias.gov.tr/dgpys/services/EVDServis and the WSA Action =
the same writing with :
http://http://dgpys.teias.gov.tr/dgpys/services/EVDServis
:(
Exception in thread "main" javax.xml.ws.soap.SOAPFaul
the same writing with :
http://http://dgpys.teias.gov.tr/dgpys/services/EVDServis
:(
EVDServis service = new EVDServis();
QName portQName = new QName("http://ws.dgpys.deloitte.com", "EVDServisSOAP11port_http");
String req = "<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\"><Body><login xmlns=\"http://ws.dgpys.deloitte.com\"><loginMessage><Password v=\"deneme\"/><UserName v=\"deneme\"/></loginMessage></login></Body></Envelope>";
try { // Call Web Service Operation
Dispatch<Source> sourceDispatch = service.createDispatch(portQName, Source.class, javax.xml.ws.Service.Mode.MESSAGE );
Source result = sourceDispatch.invoke(new StreamSource(new StringReader(req)));
Result streamResult = new StreamResult(System.out);
System.out.println("*********result*********");
TransformerFactory.newInstance().newTransformer().transform(result, streamResult);
} catch (Exception ex){
System.out.print(ex.toString());
}
I don't get an exception, but I don't get any result either. I am probably missing something here, so if you don't get other input I would contact a moderator using the Request Attention to attract other Experts who may spot something different.
ASKER
When i change PAYLOAD to MESSAGE also i am not getting any error :) but i do not get a result too.
I do not understand how or why :S
I do not understand how or why :S
ASKER
emergency and something very strange at the end of our talking with Mwvisa ,Stylus Studio 2010 XML EnterPrise suite is able to get response from web service
Our web service address is :
http://dgpys.teias.gov.tr/dgpys/services/EVDServis?wsdl
and after adding this there is only one thing to do change endpoint addresses to this :
<wsdl:service name="EVDServis">
<wsdl:port name="EVDServisSOAP11port_ http" binding="dgp:EVDServisSOAP 11Binding" >
<soap:address location="http://dgpys.teias.gov.tr/dgpys/services/EVDServis"/>
</wsdl:port>
<wsdl:port name="EVDServisSOAP12port_ http" binding="dgp:EVDServisSOAP 12Binding" >
<soap12:address location="http://dgpys.teias.gov.tr/dgpys/services/EVDServis"/>
</wsdl:port>
</wsdl:service>
and then as i said stylus studio able to get an answer when we send this request :
<?xml version="1.0"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<login xmlns="http://ws.dgpys.deloitte.com">
<loginMessage>
<Password v="deneme"/>
<UserName v="deneme"/>
</loginMessage>
</login>
</Body>
</Envelope>
and the result is :
<?xml version="1.0" encoding="UTF-8"?><soapenv :Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing"><soapenv:Head er><wsa:Re plyTo><wsa :Address>http://www.w3.org/2005/08/addressing/none< /wsa:Addre ss><wsa:Re ferencePar ameters><a xis2:Servi ceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:D1 03FAD43998 C378311284 324782782< /axis2:Ser viceGroupI d></wsa:Re ferencePar ameters></ wsa:ReplyT o></soapen v:Header>< soapenv:Bo dy><LoginR eport><Cod e v="-1"/><Text v="Authorization error!"/></LoginReport></s oapenv:Bod y></soapen v:Envelope >
but we could not succedd
Please helpppp
Our web service address is :
http://dgpys.teias.gov.tr/dgpys/services/EVDServis?wsdl
and after adding this there is only one thing to do change endpoint addresses to this :
<wsdl:service name="EVDServis">
<wsdl:port name="EVDServisSOAP11port_
<soap:address location="http://dgpys.teias.gov.tr/dgpys/services/EVDServis"/>
</wsdl:port>
<wsdl:port name="EVDServisSOAP12port_
<soap12:address location="http://dgpys.teias.gov.tr/dgpys/services/EVDServis"/>
</wsdl:port>
</wsdl:service>
and then as i said stylus studio able to get an answer when we send this request :
<?xml version="1.0"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<login xmlns="http://ws.dgpys.deloitte.com">
<loginMessage>
<Password v="deneme"/>
<UserName v="deneme"/>
</loginMessage>
</login>
</Body>
</Envelope>
and the result is :
<?xml version="1.0" encoding="UTF-8"?><soapenv
but we could not succedd
Please helpppp
Hopefully you get some other help, but even the stylus studio is returning LoginReport without the expected namespace which is the exception we are getting. I would contact the owner of service and make sure using right approach (i.e., should you use jax-rpc for example) ... as I said, I compiled a proxy class in Eclipse just fine using Axis2, which you can add support for in Netbeans, but I would have them give you details or find another company utilizing and see if they know of the know bug in xml being different than the wsdl specifies with regard to the namespace.
ASKER
But i should think that if this program was fail for this :
Stylus Studio 2010 XML Enterprise Suite
but it gets the right answer without any modification unfortunately
Stylus Studio 2010 XML Enterprise Suite
but it gets the right answer without any modification unfortunately
The stylus studio is just returning you the XML whereas the client generated is trying to adhere *strictly* (or literally) to the XML required as defined by the WSDL. If you look at the login method stub you will see that it specifically states that the output will be LoginReport with specific namespace. Therefore, this approach may not be the best. You may need to for example, create an XML request that conforms to the required form specified by the SOAP example and post to the web service and simply read the response XML yourself.
Again, if you use JAX-RPC or Axis2 style, you may even see different results.
To take the ambiguity out of it, I would just ask the provider of the service since you have a relationship with them. If you cannot, then you will have to figure out which approach works best with this service through trial and error. Being across the pond, I suspect some of the difficulties I have in connections at times are related to that -- the Eclipse method seemed like it was going to work, but got connection timeout so couldn't verify.
Again, if you use JAX-RPC or Axis2 style, you may even see different results.
To take the ambiguity out of it, I would just ask the provider of the service since you have a relationship with them. If you cannot, then you will have to figure out which approach works best with this service through trial and error. Being across the pond, I suspect some of the difficulties I have in connections at times are related to that -- the Eclipse method seemed like it was going to work, but got connection timeout so couldn't verify.
ASKER
I tryed with the true login information on stlyus xml studio it returned a successfully connection info ; then i tryed on our code but got the same result. So we need to what this trial program do.
"The stylus studio is just returning you the XML whereas the client generated is trying to adhere *strictly* (or literally) to the XML required as defined by the WSDL. If you look at the login method stub you will see that it specifically states that the output will be LoginReport with specific namespace. Therefore, this approach may not be the best. You may need to for example, create an XML request that conforms to the required form specified by the SOAP example and post to the web service and simply read the response XML yourself. "
From this part of your answer, if we could do it maybe we will be able to go to next step but i can not figure out what is our problem with the web service connection. I am nearly getting crazy :(
"The stylus studio is just returning you the XML whereas the client generated is trying to adhere *strictly* (or literally) to the XML required as defined by the WSDL. If you look at the login method stub you will see that it specifically states that the output will be LoginReport with specific namespace. Therefore, this approach may not be the best. You may need to for example, create an XML request that conforms to the required form specified by the SOAP example and post to the web service and simply read the response XML yourself. "
From this part of your answer, if we could do it maybe we will be able to go to next step but i can not figure out what is our problem with the web service connection. I am nearly getting crazy :(
Okay, sorry for the delay. Guess I have too many things going on that I didn't remember I had recently had to reload this entire machine ; therefore, Axis2 was not configured properly in my Eclipse, so I had tried with Axis previously. At any rate, once I got Axis2 configured I generated client from WSDL in Eclipse and tested the following request via SOAP11Binding :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://ws.dgpys.deloitte.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
Then I successfully got this results:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
http://www.w3.org/2005/08/addressing/none
urn:uuid:AA1FA3E19A8DDF41D A128466678 9668
</soapenv:Header>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
Noticed that LoginReport doesn't have a namespace defined which is consistent with the error message you are getting. For Axis2 client deployment, a couple things I tried which may have helped this to work:
+I included the port number in the service location even though it is default port 80 as that has been known to work and noticed they were doing so originally with the IP address we replaced.
<soap:address location="http://dgpys.teias.gov.tr:80/dgpys/services/EVDServis"/>
+I had data binding off, but that was because I had a problem with something ... I went back and ran it again just now with ADB and worked the same, so most likely the port as without that I was getting an unknown server error.
At any rate, I got this to work and have verified the XML returned doesn't have a LoginReport node with a namespace ; therefore, the JAXB error is valid since a namespace is expected per the definition. I have seen this documented as fixable using SAX Filter , so you can search around Sun site for example.
Guess I don't use JAXB enough given I tend to just use Axis2 and Eclipse as it appears this is a known issue going way back in Sun forum, so you can search around for unmarshalling JAXB without namespace if you want to research that more otherwise I would suggest using Axis2 client to connect with this service as that appears to work just fine.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://ws.dgpys.deloitte.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
Then I successfully got this results:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
http://www.w3.org/2005/08/addressing/none
urn:uuid:AA1FA3E19A8DDF41D
</soapenv:Header>
<soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
Noticed that LoginReport doesn't have a namespace defined which is consistent with the error message you are getting. For Axis2 client deployment, a couple things I tried which may have helped this to work:
+I included the port number in the service location even though it is default port 80 as that has been known to work and noticed they were doing so originally with the IP address we replaced.
<soap:address location="http://dgpys.teias.gov.tr:80/dgpys/services/EVDServis"/>
+I had data binding off, but that was because I had a problem with something ... I went back and ran it again just now with ADB and worked the same, so most likely the port as without that I was getting an unknown server error.
At any rate, I got this to work and have verified the XML returned doesn't have a LoginReport node with a namespace ; therefore, the JAXB error is valid since a namespace is expected per the definition. I have seen this documented as fixable using SAX Filter , so you can search around Sun site for example.
Guess I don't use JAXB enough given I tend to just use Axis2 and Eclipse as it appears this is a known issue going way back in Sun forum, so you can search around for unmarshalling JAXB without namespace if you want to research that more otherwise I would suggest using Axis2 client to connect with this service as that appears to work just fine.
ASKER
This is perfect i will try it to tomorrow now i am out of my city. But that is all i need to do already if this works on my pc too god bless you :)
ASKER
Should i want 2 things :)
1- Should you share the code with me
2- I looked but i could not find how to connect to Axis2 Web Services
Thank you
1- Should you share the code with me
2- I looked but i could not find how to connect to Axis2 Web Services
Thank you
Here you go: https://filedb.experts-exchange.com/incoming/ee-stuff/7999-dgpys.zip
p.s., I just realized that you had posted a Resource Adapter Archive, previously. With Eclipse now installed, I probably could have read that file -- oh well...
p.s., I just realized that you had posted a Resource Adapter Archive, previously. With Eclipse now installed, I probably could have read that file -- oh well...
Nevermind, it would appear that it was as I thought a .RAR zip format and Eclipse couldn't open it. Anyway, good luck.
ASKER
I will check it out today. Thank you very much i think i will succeed on this way....
Thank you for all your help
Thank you for all your help
ASKER
I am sorry mwvisa1 but it returns me for login method that you send the code :
Result
exception: unknown
for correct and non correct tryings and eclipse generate no error for application
Result
exception: unknown
for correct and non correct tryings and eclipse generate no error for application
ASKER
Actually when i remove the try catch part it shows :
exception
org.apache.jasper.JasperEx ception: An exception occurred processing JSP page /Result.jsp at line 112
109: <jsp:useBean id="com1deloitte1dgpys1ws1 holders1St ringValueH older_9id" scope="session" class="com.deloitte.dgpys. ws.holders .StringVal ueHolder" />
110: <%
111: com1deloitte1dgpys1ws1hold ers1String ValueHolde r_9id.valu e = com1deloitte1dgpys1ws1Stri ngValue_10 id;
112: sampleEVDServisPortTypePro xyid.login (com1deloi tte1dgpys1 ws1LoginMe ssage_1id, com1deloit te1dgpys1w s1holders1 IntValueHo lder_6id,c om1deloitt e1dgpys1ws 1holders1S tringValue Holder_9id );
113: break;
114: }
115:
Stacktrace:
org.apache.jasper.servlet. JspServlet Wrapper.ha ndleJspExc eption(Jsp ServletWra pper.java: 510)
org.apache.jasper.servlet. JspServlet Wrapper.se rvice(JspS ervletWrap per.java:4 07)
org.apache.jasper.servlet. JspServlet .serviceJs pFile(JspS ervlet.jav a:313)
org.apache.jasper.servlet. JspServlet .service(J spServlet. java:260)
javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 717)
root cause
exception
org.apache.jasper.JasperEx
109: <jsp:useBean id="com1deloitte1dgpys1ws1
110: <%
111: com1deloitte1dgpys1ws1hold
112: sampleEVDServisPortTypePro
113: break;
114: }
115:
Stacktrace:
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
root cause
Not sure why you are getting that. If you have Eclipse configured with Axis2, then you are probably better off re-running the Generate Client wizard and test again. Probably missed some configuration of project by just copying files.
ASKER
I use the complete your code but error is strange check this out
org.apache.jasper.JasperException: An exception occurred processing JSP page /Result.jsp at line 112
109: <jsp:useBean id="com1deloitte1dgpys1ws1holders1StringValueHolder_9id" scope="session" class="com.deloitte.dgpys.ws.holders.StringValueHolder" />
110: <%
111: com1deloitte1dgpys1ws1holders1StringValueHolder_9id.value = com1deloitte1dgpys1ws1StringValue_10id;
112: sampleEVDServisPortTypeProxyid.login(com1deloitte1dgpys1ws1LoginMessage_1id,com1deloitte1dgpys1ws1holders1IntValueHolder_6id,com1deloitte1dgpys1ws1holders1StringValueHolder_9id);
113: break;
114: }
115:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:407)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
unknown
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
javax.xml.parsers.SAXParser.parse(Unknown Source)
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
org.apache.axis.client.Call.invokeEngine(Call.java:2784)
org.apache.axis.client.Call.invoke(Call.java:2767)
org.apache.axis.client.Call.invoke(Call.java:2443)
org.apache.axis.client.Call.invoke(Call.java:2366)
org.apache.axis.client.Call.invoke(Call.java:1812)
com.deloitte.dgpys.ws.EVDServisSOAP11BindingStub.login(EVDServisSOAP11BindingStub.java:696)
com.deloitte.dgpys.ws.EVDServisPortTypeProxy.login(EVDServisPortTypeProxy.java:50)
org.apache.jsp.Result_jsp._jspService(Result_jsp.java:266)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
erf.png
Here are some tutorials on generating webservice client via Eclipse:
http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/WebServiceClient/WebServiceClient.html
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
You should be able to reproduce the quick code I used to test, but it will ensure that all the project configuration and references to Axis2 are included correctly. As I said before, I simply used the Generate Client to test what the XML was coming back as for you; therefore, none of the code was custom and so is just a matter of generating within your Eclipse as I suspect there is web project configuration that didn't transfer with the files I sent above.
http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/WebServiceClient/WebServiceClient.html
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
You should be able to reproduce the quick code I used to test, but it will ensure that all the project configuration and references to Axis2 are included correctly. As I said before, I simply used the Generate Client to test what the XML was coming back as for you; therefore, none of the code was custom and so is just a matter of generating within your Eclipse as I suspect there is web project configuration that didn't transfer with the files I sent above.
ASKER
I was lookng all they to this :
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
there is only one difference between us i have no window after adding web service address like given on image
c2-b.png
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
there is only one difference between us i have no window after adding web service address like given on image
c2-b.png
When you first launch the Generate Client screen, you should see the screen with the bar you can lower or raise to determine how much to do -- push this all the way to test client by the way -- on the right you will see three links that say server, Axis, and project name:
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/images/c2_a.png
Click on the middle one and you should see the screen above where you can select the axis version and server.
http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/images/c2_a.png
Click on the middle one and you should see the screen above where you can select the axis version and server.
ASKER
I look so deeply yesterday when i create web servie client under Axis2 properties it did not generate a code com.deloitte.dgpys.ws.EVDS ervisPortT ypeProxy sth. like this and all your jsp codes are includes this class when i build web service client with axis properties it generate this class so i could not understand how this happens
Thing those were from the Axis test I ran. With Axis2, I used the Web Services Explorer in Eclipse to test.
ASKER
yes now i am also succedd from calling web service explorer with axis2 client but still could not make the same on the program it always generate very strange errors
Did you convert the program to use Axis2 generated stubs/proxy OR looked at unmarshalling JAXB without namespaces to get that resolved ? If you are still using the same JAXB code that expects LoginReport to have a namespace and JAXB unmarshalling is set to strictly adhere to this, then you will continue to have the issues.
ASKER
I convert it to axis 2 but i change on the wsdl firstly errors and install it to my ftp and eclipse download it from my source :
http://test.3xlhost.com/dgpys.teias.gov.tr.wsdl
then web service explorer is working now. But i am stiill not able to connect because this time jsp pages does not accept this part :
<jsp:useBean id="sampleEVDServisPortTyp eProxyid" scope="session" class="com.deloitte.dgpys. ws.EVDServ isPortType Proxy" /> on the lines like this it does not accept :
com.deloitte.dgpys.ws.EVDS ervisPortT ypeProxy
errrr.png
http://test.3xlhost.com/dgpys.teias.gov.tr.wsdl
then web service explorer is working now. But i am stiill not able to connect because this time jsp pages does not accept this part :
<jsp:useBean id="sampleEVDServisPortTyp
com.deloitte.dgpys.ws.EVDS
errrr.png
ASKER
I realize that when i use stub it seems ok but when i use proxy it gives lots of error so how should i connect with stub :D
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No i also write on rentacoder web site it is the same text for declare that this service is just has one way to connect - java.
We both think the same yes it only use axis2 but i could not develop a code axis2 with stub :( and i have so limited time as you could see i am nearly 24 hour working on this :(
We both think the same yes it only use axis2 but i could not develop a code axis2 with stub :( and i have so limited time as you could see i am nearly 24 hour working on this :(
Yes. Sorry I couldn't help more ... day job also.
ASKER
Hi mwvisa :D again it is me i have solved the problem over the .net with creating my own proxy to call web service but on some servicess i am getting a result as the given on this question :
https://www.experts-exchange.com/questions/26483717/org-xml-sax-SAXParseException-Premature-end-of-file.html
if you check it out i will be very glad
https://www.experts-exchange.com/questions/26483717/org-xml-sax-SAXParseException-Premature-end-of-file.html
if you check it out i will be very glad
ASKER
<?xml version="1.0" encoding="UTF-8"?><soapenv
but i am getting nothing this is the code that i use
Open in new window
scr.png