Travelport / travelport-uapi-tutorial

The travelport-uapi-tutorial is a Java project for Universal API that will help you connect and code a standard workflow including Air and Hotel.
45 stars 34 forks source link

HTTP response '401: Unauthorized' #579

Open wufengfu opened 6 years ago

wufengfu commented 6 years ago

Hi someone: After I download demo from git, run sysping in Lesson 1. And returned: HTTP response '401: Unauthorized' The request URI:https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/SystemService and I change the method of checkProperties in class name of WSDLService: String user = System.getProperty(USERNAME_PROP); String pwd = System.getProperty(PASSWORD_PROP); String gds = System.getProperty(GDS_PROP); String tb = System.getProperty(TARGET_BRANCH);

    user = "Universal API/uAPI8490522938-d3ed7035";
    pwd = "******";
    gds = "1G";
    tb = "P7101350";

The Console is : org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:309) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:523) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:432) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:347) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:305) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) at com.sun.proxy.$Proxy48.service(Unknown Source) at com.travelport.uapi.unit1.Lesson1.main(Lesson1.java:39) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '401: Unauthorized' when communicating with https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/SystemService at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doProcessResponseCode(HTTPConduit.java:1614) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1621) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1565) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1366) at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56) at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:218) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:663) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63) ... 9 more for your response. thanks.

wufengfu commented 6 years ago

I have solved this problem by not setting parameters to system, and followed by references to value values in system.

Thanks anyway.

raghubedi2004 commented 5 years ago

Hi @wufengfu , I am also facing similar issue. Can you please elaborate on the fix which you did ?