/** * Adds the endpoint to the document. * * @param doc * @param rootElement */ protected void addEndpoint(Document doc, Element rootElement) throws Exception { Element endpointElement = doc.createElement("endpoint"); String endpoint = this.axisEndpoint.getEndpointURL(); Text text = doc.createTextNode((endpoint != null) ? endpoint : ""); endpointElement.appendChild(text); rootElement.appendChild(endpointElement); }
private void traceRequestLine(final MessageContext inMessageContext) { if (reqResTraceLog.isTraceEnabled()) { requestTime = System.currentTimeMillis(); AxisService axisService = inMessageContext.getAxisService(); String epName = axisService.getEndpointName(); epName = axisService.getEndpoint(epName).getEndpointURL(); reqResTraceLog.trace("To:" + epName + ",MessageID:" + inMessageContext.getMessageID() + ",Direction:request" + ",requestTime:" + requestTime); } }
public static AxisService createClientSideAxisService( Definition wsdlDefinition, QName wsdlServiceName, String portName, Options options) throws AxisFault { WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder( wsdlDefinition, wsdlServiceName, portName); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints() .get(axisService.getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding() .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; }
public static AxisService createClientSideAxisService( Definition wsdlDefinition, QName wsdlServiceName, String portName, Options options) throws AxisFault { WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder( wsdlDefinition, wsdlServiceName, portName); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints() .get(axisService.getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding() .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; }
/** * returns a axisService given a input Stream of WSDL2.0 document. * * @param description * WSDL description * @param wsdlServiceName * @param endPoint * @param options * @return * @throws AxisFault */ public static AxisService createClientSideAxisService(Description description, QName wsdlServiceName, String endPoint, Options options) throws AxisFault { WSDL20ToAxisServiceBuilder serviceBuilder = new WSDL20ToAxisServiceBuilder(description, wsdlServiceName, endPoint); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoint(axisService .getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding().getProperty( WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; } private void printDescriptionObject(Description definition,
public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace whttp) { String property; OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMElement endpointElement = omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl); endpointElement.addAttribute( omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, name)); endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.BINDING_LOCAL_NAME, null, tns.getPrefix() + ":" + getBinding().getName() .getLocalPart())); endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, getEndpointURL())); Object authenticationScheme = this.options.get(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE); if (authenticationScheme != null) { endpointElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_AUTHENTICATION_TYPE, whttp, authenticationScheme.toString())); } property = (String)options.get(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM); if (property != null) { endpointElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_AUTHENTICATION_REALM, whttp, property)); } WSDLSerializationUtil.addWSDLDocumentationElement(this, endpointElement, omFactory, wsdl); WSDLSerializationUtil.addPoliciesAsExtensibleElement(this, endpointElement); return endpointElement; }
private String getEndpointURL(AxisEndpoint axisEndpoint) { Parameter modifyAddressParam = axisService.getParameter("modifyUserWSDLPortAddress"); String endpointURL = axisEndpoint.getEndpointURL(); if (modifyAddressParam != null && !Boolean.parseBoolean((String)modifyAddressParam.getValue())) { return endpointURL; } String hostIP; // First check the hostname parameter hostIP = Utils.getHostname(axisService.getAxisConfiguration()); //If it is not set extract the hostIP from the URL if (hostIP == null) { hostIP = WSDLSerializationUtil.extractHostIP(axisService.getEndpointURL()); } //TODO This is to prevent problems when JAVA2WSDL tool is used where there is no //Axis server running. calculateEndpointURL fails in this scenario, refer to // SimpleHTTPServer#getEPRsForService() if (hostIP != null) { return axisEndpoint.calculateEndpointURL(hostIP); } else { return endpointURL; } }
options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); if (axisEndpoint != null) { options.setSoapVersionURI((String)axisEndpoint.getBinding().getProperty(WSDL2Constants.ATTR_WSOAP_VERSION));
private String getEndpointURL(AxisEndpoint axisEndpoint) { Parameter modifyAddressParam = axisService.getParameter("modifyUserWSDLPortAddress"); String endpointURL = axisEndpoint.getEndpointURL(); if (modifyAddressParam != null && !Boolean.parseBoolean((String)modifyAddressParam.getValue())) { return endpointURL; } String hostIP; // First check the hostname parameter hostIP = Utils.getHostname(axisService.getAxisConfiguration()); //If it is not set extract the hostIP from the URL if (hostIP == null) { hostIP = WSDLSerializationUtil.extractHostIP(axisService.getEndpointURL()); } //TODO This is to prevent problems when JAVA2WSDL tool is used where there is no //Axis server running. calculateEndpointURL fails in this scenario, refer to // SimpleHTTPServer#getEPRsForService() if (hostIP != null) { return axisEndpoint.calculateEndpointURL(hostIP); } else { return endpointURL; } }
/** * returns a axisService given a input Stream of WSDL2.0 document. * * @param description * WSDL description * @param wsdlServiceName * @param endPoint * @param options * @return * @throws AxisFault */ public static AxisService createClientSideAxisService(Description description, QName wsdlServiceName, String endPoint, Options options) throws AxisFault { WSDL20ToAxisServiceBuilder serviceBuilder = new WSDL20ToAxisServiceBuilder(description, wsdlServiceName, endPoint); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoint(axisService .getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding().getProperty( WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; } private void printDescriptionObject(Description definition,
public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace whttp) { String property; OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMElement endpointElement = omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl); endpointElement.addAttribute( omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, name)); endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.BINDING_LOCAL_NAME, null, tns.getPrefix() + ":" + getBinding().getName() .getLocalPart())); endpointElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, getEndpointURL())); Object authenticationScheme = this.options.get(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE); if (authenticationScheme != null) { endpointElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_AUTHENTICATION_TYPE, whttp, authenticationScheme.toString())); } property = (String)options.get(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM); if (property != null) { endpointElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_AUTHENTICATION_REALM, whttp, property)); } WSDLSerializationUtil.addWSDLDocumentationElement(this, endpointElement, omFactory, wsdl); WSDLSerializationUtil.addPoliciesAsExtensibleElement(this, endpointElement); return endpointElement; }