JBuilder SOAP request completion based on Authentication Header.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Oscar_Diaz
Posted On:   Thursday, April 6, 2006 11:41 AM

How I can setup HTTP Header Key in an AXIS Soap Request in Jbuilder? I already have all the classes generated by JBuilder Web Service Designer including AuthHeader.java. I'm able to access the service with the generated skeletons but dont know how to setup the Authentication Key on the SOAP header request. Here is part of my code: MyServiceSoap srv = null; try { srv = new MyServiceLocator().getMyServiceSoap(); return srv.addImage(recId, imageUrl, fileType, displayName); } catch (Exception e) { e.printStackTrace(); } That code works if the Webservice Server removes the verifi   More>>

How I can setup HTTP Header Key in an AXIS Soap Request in Jbuilder?


I already have all the classes generated by JBuilder Web Service Designer including AuthHeader.java.


I'm able to access the service with the generated skeletons but dont know how to setup the Authentication Key on the SOAP header request.

Here is part of my code:



MyServiceSoap srv = null;



try {

srv = new MyServiceLocator().getMyServiceSoap();

return srv.addImage(recId, imageUrl, fileType, displayName);


} catch (Exception e) {

e.printStackTrace();

}



That code works if the Webservice Server removes the verification-key on the header, but thats the way they have to validate that Im a valid user to consume the service:



Here is the generated JBuilder code for AuthHeader.java, and i need to instantiate it from the code above but dont know how:


public class AuthHeader implements java.io.Serializable {

private java.lang.String key;


public AuthHeader() {

}



public AuthHeader(

java.lang.String key) {

this.key = key;

}







public java.lang.String getKey() {

return key;
}



public void setKey(java.lang.String key) {

this.key = key;

}



private java.lang.Object __equalsCalc = null;

public synchronized boolean equals(java.lang.Object obj) {

if (!(obj instanceof AuthHeader)) return false;

AuthHeader other = (AuthHeader) obj;

if (obj == null) return false;

if (this == obj) return true;

if (__equalsCalc != null) {

return (__equalsCalc == obj);

}

__equalsCalc = obj;

boolean _equals;

_equals = true &&

((this.key==null && other.getKey()==null) ||
(this.key!=null &&
this.key.equals(other.getKey())));
__equalsCalc = null;
return _equals;
}



private boolean __hashCodeCalc = false;

public synchronized int hashCode() {

if (__hashCodeCalc) {

return 0;

}

__hashCodeCalc = true;

int _hashCode = 1;

if (getKey() != null) {

_hashCode += getKey().hashCode();

}

__hashCodeCalc = false;

return _hashCode;

}



}


Greetz and thanks a lot,


Oscar    <<Less
About | Sitemap | Contact