creating soap messages manually

 

If you have VersionMismatchException on weblogic server it is the best way to create soap messages manually, there is a code sample below which prepares soapmessages;

 

MessageFactory mf;
mf = MessageFactory.newInstance();
SOAPMessage message = mf.createMessage();

SOAPBody body = message.getSOAPBody();
SOAPHeader header = message.getSOAPHeader();

SOAPPart soapPart = message.getSOAPPart();

// below code prepares env tag

// <env:Envelope xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:tem=”http://tempuri.org/”>SOAPEnvelope envelope =

soapPart.getEnvelope();
envelope.addNamespaceDeclaration(“tem”, “http://tempuri.org/&#8221;);

//  <env:Header>
// <tem:Authenticate> code below prepares header and authanticate tag

QName auth = new QName( “http://tempuri.org/&#8221;, “Authenticate”, “tem”);
SOAPElement authEl = header.addChildElement(auth);

 

// below code prepares body content

QName activities= new QName( “http://tempuri.org/&#8221;, “activities”, “tem”);
SOAPElement acEl= body.addChildElement(activities);

QName uCode = new QName( “http://tempuri.org/&#8221;, “userCode”, “tem”);
SOAPElement uCodeEl = userActi.addChildElement(uCode);
uCodeEl.addTextNode(userCode);

 

useful linux commands

chmod -R 777 xyzfolder

changes folder permissions to mode 777 right set. -R is used as a recursion signature  means that commands will be executed for all inner folders and files inside this folder. 777 is a abbrevation of triple permission blocks and can be widen as

Read  Write  Execute

7 –> 1        1         1

first 7 works for owner

second 7 works for group

third for world

777 –> drwxrwxrwx

d means directory and the others are permissions, directory can be read execute and write by all type of users.

Another example:

chmod -R 651 xyzfolder

7 = 4+2+1 (read/write/execute)
6 = 4+2 (read/write)
5 = 4+1 (read/execute)
4 = 4 (read)
3 = 2+1 (write/execute)
2 = 2 (write)
1 = 1 (execute)

Owner can read and write

Group can read and execute

World can only executes

 

grails pagination

Grails documentation is not giving the solution on pagination thats why i’m writing pagination steps here;

 

probably you are sending instance list from controller

FooController{

def index() {
        params.max = 10
        params.offset = 0
        redirect(action:”list”, params:params)
    }

 

def list (){

 

def max = 10
        def offset = 0
        if(params.max){
            max = params.max
        }
        if(params.offset){
            offset = params.offset
        }
        [fooList: Foo.list(max:max, offset:offset),

}

}

list.gsp

        <div>
            <g:paginate total=”${fooList.size()}” action=”list” controller=”price”  />
        </div>

 

 

grails tips

  • changing server startup port param: -Dserver.port
  • put application version to gsp files: <g:meta name=”app.version”/>
  • getting application parameter values: if you want to use application parameters on your application, do it in a service class , inject grailsApplication to your service class and type;
    grailsApplication.metadata.’application.foo’

google announced android ide (based on idea)

while eclipse is a well-known ide for android developers for now on they have another option for developing. google announced a new ide for android developers. android studio is based on great idea. some new features of this ide;

  • page preview and layout editing capability
  • performance on android api integration
  • resources handling

ide using gradle for building process. about repository management svn,cvs and git are avaible within

is quoted from